// File Name: usart_interrupt.c
// Author: kukukukuku~
// Date: 2024-12-21

#include "apm32f00x_usart.h"
#include "./USART/inc/usart_var.h"

void USART_USART_RX_IRQ_HANDLE(void)
{
    if(USART_ReadIntFlag(USART_USART, USART_INT_FLAG_IDLE))
    {
        usart_int_idle_callback(&usartObj);
        
        usart_usart_receive_data();
    }
    
    if(USART_ReadIntFlag(USART_USART, USART_INT_FLAG_RX))
    {
        usart_int_rx_callback(&usartObj);
        
        USART_ClearIntFlag(USART_USART, USART_INT_FLAG_RX);
    }
}
